﻿package mortal.game.proxy
{
    import Framework.Util.*;
    import Message.Game.*;
    import extend.language.*;
    import flash.utils.*;
    import mortal.common.error.*;
    import mortal.game.events.*;
    import mortal.game.manager.*;
    import mortal.game.manager.msgTip.*;
    import mortal.game.mvc.*;
    import mortal.mvc.core.*;

    public class FashionProxy extends Proxy
    {

        public function FashionProxy()
        {
            return;
        }// end function

        public function advance(param1:Boolean, param2:int, param3:Dictionary, param4:Boolean) : void
        {
            rmi.iFashion.advance_async(new AMI_IFashion_advance(this.advanceSucc, this.advanceFail, param4), param1, param2, param3);
            return;
        }// end function

        private function advanceSucc(param1:AMI_IFashion_advance, param2:int) : void
        {
            var autoAdvance:Function;
            var e:* = param1;
            var result:* = param2;
            autoAdvance = function () : void
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.FashionAutoAdvance));
                return;
            }// end function
            ;
            if (result)
            {
                MsgManager.showMouseMsg(Language.getString(20549), MsgRollTipsType.msgRollTips2);
                Dispatcher.dispatchEvent(new DataEvent(EventName.FashionCancelAutoAdvance));
                NetDispatcher.dispatchCmd(ServerCommand.FashionAdvanceSucc, null);
            }
            else if (e.userObject == true)
            {
                setTimeout(autoAdvance, 200);
            }
            Dispatcher.dispatchEvent(new DataEvent(EventName.FashionOnceAdvance, result));
            return;
        }// end function

        private function advanceFail(param1:Exception) : void
        {
            var _loc_2:* = param1.message as String;
            MsgManager.showRollTipsMsg(_loc_2, MsgRollTipsType.msgRollTips3);
            Dispatcher.dispatchEvent(new DataEvent(EventName.FashionCancelAutoAdvance));
            return;
        }// end function

        public function changeShape(param1:int, param2:int) : void
        {
            rmi.iFashion.changeShape_async(new AMI_IFashion_changeShape(this.changeSucc, this.changeFail), param1, param2);
            return;
        }// end function

        private function changeSucc(param1:AMI_IFashion_changeShape) : void
        {
            MsgManager.showMouseMsg(Language.getString(20550), MsgRollTipsType.msgRollTips2);
            return;
        }// end function

        private function changeFail(param1:Exception) : void
        {
            MsgManager.showMouseMsg(ErrorCode.getErrorStringByCode(param1.code), MsgRollTipsType.msgRollTips3);
            return;
        }// end function

        public function hideOrShowFashion(param1:int) : void
        {
            rmi.iFashion.hideOrShow_async(new AMI_IFashion_hideOrShow(), param1);
            return;
        }// end function

        public function dress(param1:int, param2:String, param3:String) : void
        {
            var _loc_4:Object = {putonUid:param2, getoffUid:param3};
            rmi.iFashion.dress_async(new AMI_IFashion_dress(this.dressSuccess, this.dressFail), param1, param2, param3);
            return;
        }// end function

        private function dressSuccess(param1:AMI_IFashion_dress) : void
        {
            return;
        }// end function

        private function dressFail(param1:Exception) : void
        {
            var _loc_2:* = param1.message as String;
            MsgManager.showRollTipsMsg(_loc_2, MsgRollTipsType.msgRollTips3);
            return;
        }// end function

        public function getAdvanceReward(param1:int, param2:int) : void
        {
            rmi.iFashion.getAdvanceReward_async(new AMI_IFashion_getAdvanceReward(this.takeSucc, this.takeFail), param1, param2);
            return;
        }// end function

        private function takeSucc(param1:AMI_IFashion_getAdvanceReward, param2:Boolean) : void
        {
            return;
        }// end function

        private function takeFail(param1:Exception) : void
        {
            MsgManager.showRollTipsMsg(ErrorCode.getErrorStringByCode(param1.code));
            return;
        }// end function

        public function activeFashion(param1:Boolean, param2:int, param3:Dictionary) : void
        {
            rmi.iFashion.openComponent_async(new AMI_IFashion_openComponent(), param1, param2, param3);
            return;
        }// end function

        public function changeShapeCard(param1:int) : void
        {
            rmi.iFashion.changeShapeCard_async(new AMI_IFashion_changeShapeCard(), param1);
            return;
        }// end function

    }
}
